<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('琛ㄦ牸鍥剧墖棰勮')" />
</head>
<body class="gray-bg">
     <div class="container-div">
		<div class="row">
			<div class="col-sm-12 select-table table-striped">
				<table id="bootstrap-table"></table>
			</div>
		</div>
	</div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var prefix = ctx + "demo/table";

        $(function() {
            var options = {
                url: prefix + "/list",
		        showSearch: false,
		        showRefresh: false,
		        showToggle: false,
		        showColumns: false,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'userId', 
					title : '鐢ㄦ埛ID'
				},
				{
					field : 'userCode', 
					title : '鐢ㄦ埛缂栧彿'
				},
				{
					field : 'userName', 
					title : '鐢ㄦ埛濮撳悕'
				},
				{
				    title: '鍥剧墖',
				    formatter: function(value, row, index) {
				    	// 鍥剧墖棰勮锛堟敞鎰忥細濡傚瓨鍌ㄥ湪鏈湴鐩存帴鑾峰彇鏁版嵁搴撹矾寰勶紝濡傛湁閰嶇疆context-path闇�瑕佷娇鐢╟tx+璺緞锛�
				    	// 濡傦細/profile/upload/2019/08/08/3b7a839aced67397bac694d77611ce72.png
				    	if(index % 2 == 0){
				    		return $.table.imageView('http://demo.ruoyi.vip/img/profile.jpg');
				    	}else {
				    		return $.table.imageView('http://demo.ruoyi.vip/ruoyi.png');
				    	}
				    }
				},
				{
					field : 'userPhone', 
					title : '鐢ㄦ埛鎵嬫満'
				},
				{
					field : 'userEmail', 
					title : '鐢ㄦ埛閭'
				},
				{
				    field : 'userBalance',
				    title : '鐢ㄦ埛浣欓'
				},
		        {
		            title: '鎿嶄綔',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-success btn-xs" href="#"><i class="fa fa-edit"></i>缂栬緫</a> ');
                        actions.push('<a class="btn btn-danger btn-xs" href="#"><i class="fa fa-remove"></i>鍒犻櫎</a>');
						return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>